
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
    long long N = 0;
    scanf("%lld", &N);
    long long tmp = N;
    int k = 0;
    while (tmp)
    {
        k++;
        tmp /= 10;
    }
    char* str = (char*)malloc(sizeof(char) * k);
    tmp = N;
    int a = k - 1;
    while (tmp)
    {
        str[a] = tmp % 10 + '0';
        a--;
        tmp /= 10;
    }
    if (k % 3 == 0)
    {
        int b = 0;
        for (int i = 0; i <= k - 1; i++)
        {
            printf("%c", str[i]);
            b++;
            if (b % 3 == 0 && i != k - 1)
            {
                printf(",");
            }

        }
    }
    else
    {
        int j = k - (k / 3) * 3;
        for (int i = 0; i < j; i++)
        {
            printf("%c", str[i]);
            if (i == j - 1)
            {
                printf(",");
            }
        }
        int b = 0;
        for (int i = j; i < k - 1; i++)
        {
            printf("%c", str[i]);
            b++;
            if (b % 3 == 0 && i != k - 1)
            {
                printf(",");
            }
        }
    }
    free(str);
    str = NULL;
    return 0;
}